package org.example.controller;

import lombok.RequiredArgsConstructor;
import org.example.domain.ResponseResult;
import org.example.service.UploadService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequiredArgsConstructor
public class UploadController {

    private final UploadService uploadService;


    @PostMapping("/upload")
    public ResponseResult uploadImg(@RequestParam("file") MultipartFile file){

        System.out.println("------"+file);
        return uploadService.uploadImg(file);
    }

}
